public class Practice {
    public static void main(String[] args) {
        //最值问题
       /* int[] arr1 = {15,9000,10000,9500,-5};
        int max = arr1[0];
        for (int i = 1; i < arr1.length; i++) {
            if(max<arr1[i]){
                max = arr1[i];
            }
        }*/
       /* System.out.println(max);*/


        //顺序颠倒
        /*int[] arr2 = {10,20,30,40,50};
        for (int i = 0,j = arr2.length-1; i < j; i++,j--) {
            int temp = arr2[i];
            arr2[i] = arr2[j];
            arr2[j] = temp;
        }
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]+" ");
        }
*/


        /*//冒泡排序  小到大排序
        int[] arr = {7,4,9,1,0};
        //双重循环
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if (arr[j]>arr[j+1]){
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
        for (int i:arr) {
            System.out.print(i);
        }*/


        int[] a = {1, 2, 3, 4, 5};
        int[] b = new int[a.length]; // 确保目标数组有足够的空间

        System.arraycopy(a, 0, b, 0, a.length); // 完整复制
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]);

        }
    }



}
